package cn.gzjp.modules.gas.entity;

import cn.hutool.core.date.DateUtil;
import org.hibernate.validator.constraints.Length;

import cn.gzjp.common.persistence.DataEntity;
import cn.gzjp.common.utils.excel.annotation.ExcelField;

import java.util.Date;


/**
 * 积分Entity
 * @author zengcp
 * @version 2018-03-12
 */
public class GasScore extends DataEntity<GasScore> {
	
	private static final long serialVersionUID = 1L;
	private String openid;		// openid
	private int score;		// 积分
	private String memo;		// 描述

	private Date startDate; //查询开始时间
	private Date endDate;  //结束时间

	private String unionId;
	
	public GasScore() {
		super();
	}

	public GasScore(String id){
		super(id);
	}

	@Length(min=0, max=32, message="openid长度必须介于 0 和 32 之间")
	@ExcelField(title="openid", align=2, sort=1)
	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}
	
	@Length(min=0, max=11, message="积分长度必须介于 0 和 11 之间")
	@ExcelField(title="积分", align=2, sort=2)
	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}
	
	@Length(min=0, max=256, message="描述长度必须介于 0 和 256 之间")
	@ExcelField(title="描述", align=2, sort=3)
	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getScoreDate(){
		return DateUtil.format(this.getCreateDate(), "MM月dd日 HH:mm");
	}

	public String getUnionId() {
		return unionId;
	}

	public void setUnionId(String unionId) {
		this.unionId = unionId;
	}
}